package by.blog.dao.beans;

import java.io.Serializable;

/**
 * Бондарчик Антон  15.11.2014.
 */
public class Category implements Serializable {

    private int category_id;
    private String category_name;
    private int parent_id;

    public Category() {
    }

    public int getCategory_id() {
        return category_id;
    }

    public void setCategory_id(int category_id) {
        this.category_id = category_id;
    }

    public String getCategory_name() {
        return category_name;
    }

    public void setCategory_name(String category_name) {
        this.category_name = category_name;
    }

    public int getParent_id() {
        return parent_id;
    }

    public void setParent_id(int parent_id) {
        this.parent_id = parent_id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Category)) return false;

        Category category = (Category) o;

        if (category_id != category.category_id) return false;
        if (parent_id != category.parent_id) return false;
        if (category_name != null ? !category_name.equals(category.category_name) : category.category_name != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        return category_id;
    }

    @Override
    public String toString() {
        return "Category{" +
                "category_id=" + category_id +
                ", category_name='" + category_name + '\'' +
                ", parent_id=" + parent_id +
                '}';
    }
}
